package cn.tedu.test.security;

import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;

@Configuration
public class SecConfig {

    @Autowired
    UserDetailsServiceImpl userDetailsService;

    @Autowired
    public void config(AuthenticationManagerBuilder builder) throws Exception{
        //把认证管理器中的认证信息更换为 自定义的userDetailsService
        builder.userDetailsService(userDetailsService);
    }
}
